/*
 * @Author       : Joel
 * @Date         : 2024-12-28 23:06:54
 * @LastEditors: mkandy44 mkandy44@outlook.com
 * @LastEditTime: 2025-07-15 09:01:05
 * @FilePath: /nrf52840/src/sd_pump_task.c
 * @Description  :
 * Copyright(C)2025 Aml.Ltd, All Rights Reserved.
 * 2024-12-28 23:06:54
 */
#include "pump_task.h"

const k_tid_t pump_tid;

static int pump_task_entry(void);

K_THREAD_DEFINE(pump_tid, 256, pump_task_entry, NULL, NULL, NULL,
		K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0);

static const struct gpio_dt_spec c_led = GPIO_DT_SPEC_GET_OR(DT_NODELABEL(c_led), gpios, {0});
static int pump_task_entry(void)
{
	int ret;
	if (!gpio_is_ready_dt(&c_led)) {
		return 0;
	}

	ret = gpio_pin_configure_dt(&c_led, GPIO_OUTPUT_ACTIVE);
	if (ret < 0) {
		return 0;
	}
	while (1) {
		ret = gpio_pin_toggle_dt(&c_led);
		if (ret < 0) {
			return 0;
		}
		printf("\nPump_loop\n");
		k_msleep(1000);
	}
}
